<?php
$arrfiles=array(
	'costurl0.txt',
	'costurl1.txt',
	'costurl2.txt',
	'costurl3.txt',
	'costurl4.txt',
	'costurl5.txt',
);

require_once dirname(__FILE__) . '/autoload.php';

$hasFetch=array();

$urls=array();

foreach($arrfiles as $basefile){
	$file=dirname(__FILE__).'/'.$basefile;
	@unlink($file.'.new.txt');
	$urls=file($file);
	foreach($urls as &$url){
		$url=trim($url);
		echo $url.PHP_EOL;
		$arrInfo=parse_url($url);
		$fetchurl='http://'.$arrInfo['host'];

		if(!isset($hasFetch[$fetchurl])){
			    $o = new DedeHttpDown;
				$o->OpenUrl($fetchurl);
				$s = $o->GetHtml();
				var_dump($o);die();
		}

		$hasFetch[$fetchurl]=true;

		file_put_contents($file.'.new.txt',$url.PHP_EOL,8);
	}
}
?>